import request from '../utils/request'

// 请求所有频道
export const getAllChannels = (params) => {
  return request({
    method: 'GET',
    url: '/v1_0/channels',
    params
  })
}

// 修改用户频道列表
export const addUserChannels = (channel) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: { // 请求体
      channels: [channel]
    }
  })
}

// 删除指定用户频道
export const deleteUserChannels = (channelId) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${channelId}`
  })
}
